package com.yili.oa.service.impl;

import com.yili.oa.dao.FtGamePlatformMapper;
import com.yili.oa.models.FtGamePlatform;
import com.yili.oa.models.FtGamePlatformExample;
import com.yili.oa.service.FtGamePlatformService;
import com.yili.oa.utils.annotate.DataBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@SuppressWarnings("ALL")
@Service
@DataBase("lyt_game_db")
@Transactional(value = "transactionManager")
public class FtGamePlatformServiceImpl implements FtGamePlatformService {

    @Autowired
    FtGamePlatformMapper mapper;

    @Override
    public List<FtGamePlatform> getByGameKind(Long gameKind) {
        FtGamePlatformExample example = new FtGamePlatformExample();
        FtGamePlatformExample.Criteria criteria = example.createCriteria();
        criteria.andGameKindEqualTo(gameKind);
        return mapper.selectByExample(example);
    }

    @Override
    public FtGamePlatform getById(Long id) {
        return mapper.selectByPrimaryKey(id);
    }
}
